package SLR;

import SLR.SLR;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class main {
    public static void main(String[] args) {
        List<String> G =new ArrayList<String>() ;
        int i=0;
        System.out.println("接下来请输入您想用的文法，输入Ok+回车退出");
        Scanner scanner =new Scanner(System.in);
        while( ! scanner.hasNext("ok") )
        {

            String k =scanner.next();
            if(i==0) {
                String Firstword = k.charAt(0) + "";
                G.add("S'->" + Firstword);
            }
            i++;
            G.add(k);

        }
        for (int j = 0; j <G.size() ; j++) {
            System.out.println(G.get(j));
        }
        SLR slr =new SLR(G);


    }
}
